/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package renders;

import java.awt.Color;
import java.awt.Component;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author root
 */
public class AltaAlquilerRender extends DefaultListCellRenderer implements TableCellRenderer {

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        String letra;
        if (value instanceof String) {
            letra = String.valueOf(value);
            switch (letra) {
                case "B":
                    setText("Alquiler Dado de Baja");
                    break;
                case "C":
                    setText("Reserva Cancelada");
                    break;
                case "F":
                    setText("Reserva Firme");
                    break;
                case "O":
                    setText("Alquiler");
                    break;
                case "R":
                    setText("Reserva");
                    break;
            }
        }


        if ((row % 2) == 0) {
            this.setBackground(Color.white);
        } else {
            this.setBackground(new Color(242, 242, 242));
        }
        if (isSelected) {
            this.setForeground(Color.WHITE);
            this.setBackground(new Color(57, 105, 138));
        } else {
            this.setForeground(Color.BLACK);
        }
        return this;
    }
}
